<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>  
<!DOCTYPE html>
<%@ include file="/WEB-INF/views/include/bootstrap-table.jsp"%>

<style type="text/css">

</style>

<div class="layui-fluid">
    <div class="layui-row">
        <blockquote class="layui-elem-quote news_search">
            <form id="searchForm"  class="form-search">
                   <input type="hidden" id="officeId" value="${param.officeId}"/>
                   <input type="hidden" id="roleType" value="${param.roleType}"/>
                   <input type="hidden" id="officeIdOrRoleType" value="${param.officeIdOrRoleType}"/>
		           <div class="layui-inline"> 
		                                    角色名称：
		              <div class="layui-input-inline">
		                   <input id="name" name="name"  class="layui-input search_input" type="text">
		              </div>
		                                      英文名称：
		              <div class="layui-input-inline">
		                  <input id="enname" name="enname"  class="layui-input search_input" type="text">
		              </div>
		              <a  id="btn_search" class="layui-btn search_btn">查询</a>
		          </div>
					<script type="text/javascript">
						$(function(){
							$(".search-bar ul li").each(function(){
								var spanWidth = $(this).find("span").width();
								$(this).find(".form-control").width(230-20-spanWidth);	
								$(this).children(".input-append").find(".required").width(230-20-36+1-spanWidth);	
								var barHeight = $(".search-bar").height();
								$(".search-btn").css("line-height", barHeight+"px");
							});
						})
					</script>
				</div>
				
				<div id="toolbar">                                  
				</div>
			</form>
		</blockquote>
	</div>
	
	<!-- entityCode=ZH05-SDG-01-00-12-00-1403&entityName=你好  中文会出现乱码 -->
	<!-- entityCode=ZH05-SDG-01-00-12-00-1403&entityName=你好  中文会出现乱码 -->
	<table id="table" 
	    data-toggle="table" 
	    data-url="${ctx}/sys/role/roleListJson"
	         data-toolbar="#toolbar"
		     data-height="${dataHeight306}" 
		     data-maintain-selected="true" 
		     data-side-pagination="server"
		     data-click-to-select="true" 
		     data-pagination="true" 
		     data-single-select="${param.singleSelect}"
		     data-id-field="id"
		     data-query-params="doQuery"
		     data-cache="false"
		     data-show-columns="true"
		     data-page-size="5"
		    data-page-list="${dataPageList}" >
		<thead>
			<tr>
				<th data-checkbox="true"></th>
				<th data-field="name" data-sortable="true">角色名称</th>
				<th data-field="enname">英文名称</th>
				<!-- <th data-field="office.name">归属机构</th> -->
				<!--  <th data-field="allOfficeName">归属机构</th>-->
				<th data-field="userNum">用户数</th><!-- data-visible="false" 可以隐藏列 -->
			</tr>
		</thead>
	</table>
</div>
<script type="text/javascript">
		$(function () { 
		    $("#btn_search").click(function () { 
		            $table.bootstrapTable('refresh'); 
		     });
		 }); 
		
		  //查询函数
		  function doQuery(params) {
			     
			    var name_value = $("#name").val();
				var enname_value = $("#enname").val();
				 
				if(name_value != null && name_value !=''){
					params.name = name_value;
				}
				if(enname_value != null && enname_value !=''){
					params.enname = enname_value;
				}
				
				 var officeId = $("#officeId").val();
				 
				if(officeId != null && officeId !=''){
				    params["office.id"] = officeId;
				}
				
				var roleType = $("#roleType").val();
				if(roleType != null && roleType !=''){
					params.roleType = roleType;
				}
				var officeIdOrRoleType = $("#officeIdOrRoleType").val();
				if(officeIdOrRoleType != null && officeIdOrRoleType !=''){
					params.officeIdOrRoleType = officeIdOrRoleType;
				}
				
			    return params;
		}
	</script>
	
	<jsp:include page="/WEB-INF/views/include/pageJs.jsp" />
	
	